package com.jarvis.dubbo.spi.loadBalance;


import org.apache.dubbo.common.URL;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.rpc.cluster.LoadBalance;

import java.util.List;
import java.util.logging.Logger;

/**
 * 示例
 *
 * @author jarvis create by 2020/9/16
 */
public class FirstLoadBalance implements LoadBalance {
    Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
    @Override
    public <T> Invoker<T> select(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException {
        logger.info("执行自定义路由选择...");
        return invokers.get(0);
    }
}
